﻿@model LawProject.Models.BanTinTemplate

@{
    ViewBag.Title = "ChiTietBanTinCon";
    Layout = "~/Views/Shared/AdminLayout.cshtml";
}
   <script src="@Url.Content("~/Content/ckeditor/ckeditor.js")" type="text/javascript"></script>
   <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
    <h2>Chi tiết bản tin con</h2>
@using (Html.BeginForm("BanTinConUpdate", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
            @Html.ValidationSummary(true)
            <div>
            @Html.HiddenFor(model => model.MaBanTin)
            </div>
            <div>
            @Html.HiddenFor(model => model.MaThuMucCha)
            </div>
            <div>
            @Html.HiddenFor(model => model.NguoiDT)
            </div>
             <div id="hiddenNoiDungVN">
            @Html.HiddenFor(model => model.NoiDung)
            </div>
            <div id="hiddenNoiDungEN">
            @Html.HiddenFor(model => model.NoiDungEN)
            </div>
            <div>Tiêu đề tiếng Việt</div>
            <div id="hiddenType" class="divtextbox" style="width:540px;">
                @Html.TextBoxFor(model => model.TieuDe, new { @class = "textboxedit" })
            </div>
                @*<div>Tóm tắt tiếng Việt</div>
            <div class="divtextbox" style="width:540px;">
                @Html.TextBoxFor(model => model.TomTat, new { @class = "textboxedit" })
            </div>*@
            <div class="divtextbox" style="width:540px;">
                <textarea class="ckeditor" id="editor1" rows="10" style="width:540px; height:300px; overflow-x:hidden;"></textarea>
            </div>
             
             <div>Tiêu đề tiếng Anh</div>
            <div class="divtextbox" style="width:540px;">
                @Html.TextBoxFor(model => model.TieuDeEN, new { @class = "textboxedit" })
            </div>
               @* <div>Tóm tắt tiếng Anh</div>
            <div class="divtextbox" style="width:540px;">
                @Html.TextBoxFor(model => model.TomTatEN, new { @class = "textboxedit" })
            </div>*@
            <div class="divtextbox" style="width:540px;">
                <textarea class="ckeditor" id="editor2" rows="10" style="width:540px; height:300px; overflow-x:hidden;"></textarea>
            </div>
              
               <div style="position:relative; text-align:center; width:540px;">
                <input id="submit" type="submit" value="Lưu thông tin"/>
               </div>
        
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#submit").click(function () {
            var value1 = CKEDITOR.instances['editor1'].getData();
            var value2 = CKEDITOR.instances['editor2'].getData();
            $("#hiddenNoiDungVN > input").val(value1);
            $("#hiddenNoiDungEN > input").val(value2);

        })
    })
    $(window).load(function () {
        CKEDITOR.instances['editor1'].setData($("#hiddenNoiDungVN > input").val());
        CKEDITOR.instances['editor2'].setData($("#hiddenNoiDungEN > input").val());
    });
         
        
</script>